package HomeworkChap04USB;

public class Computer {
    USB[] usbArr=new USB[]{new KeyBoard(), new Mouse()};
    //开机功能
    public void turnOn(){
        for(int i=0;i<usbArr.length;i++){
            usbArr[i].turnOn();
        }
        System.out.println("开机成功~~~~~~~~~~~");
    }
    public void turnOff(){
        for(int i=0;i<usbArr.length;i++){
            usbArr[i].turnOff();
        }
        System.out.println("关机成功~~~~~~~~~~~~");
    }
}

